home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9986 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  685 b 

  1. Path: news.mindspring.com!usenet
  2. From: tbreyman@mindspring.com (Todd M. Breyman)
  3. Newsgroups: comp.lang.c
  4. Subject: Rounding routine for doubles
  5. Date: Thu, 14 Mar 1996 21:18:23 GMT
  6. Organization: MindSpring Enterprises
  7. Message-ID: <31488c47.27813811@news.mindspring.com>
  8. NNTP-Posting-Host: user-168-121-80-158.dialup.mindspring.com
  9. X-Newsreader: Forte Agent .99d/32.182
  10.  
  11. I am trying to put together an algorithm to round doubles.  The
  12. function I am writing looks like...
  13.  
  14. double dRound (double dValue, short iPrecision)
  15.  
  16. where the function returns dValue rounded to iPrecision places.  No
  17. matter what approach I take, I am having difficulty rounding
  18. 100.00000005 to 8 places.  Any ideas?
  19.